import { AbstractControl } from '@angular/forms';

export function passwordMatcher(control: AbstractControl) {
    const password = control.get('password');
    const confirmPass = control.get('confirmPass');
    if (password.pristine && confirmPass.pristine) {
        return null;
    }
    return password.value === confirmPass.value ? null : { passwordMatcher: true };
}
